package it.controllocredito.backend.phone;

import it.controllocredito.backend.Singleton;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.telephony.PhoneStateListener;
import android.util.Log;

public class PhoneBroadcastReceiver extends BroadcastReceiver {

	private static final String log_class_name = "PhoneBroadcastReceiver";

	public PhoneBroadcastReceiver() {
		super();
		Log.v(log_class_name, "- PhoneBroadcastReceiver created");
	}
	
	@Override
	public void onReceive(Context context, Intent intent) {

		Log.v(log_class_name, "*onReceive...*");
		Singleton singleton = Singleton.getInstance();

		singleton.getTelephonyManager(context).listen(singleton.getCustomPhoneStateListener(context),
				PhoneStateListener.LISTEN_CALL_STATE);
	}

}